<template>
  <!-- 企业画像 -->
  <div>
    <iframe :src="iframeUrl" frameborder="0" width="100%"></iframe>
  </div>
</template>
<script>
export default {
  data() {
    return {
      iframeUrl: "",
    };
  },
  created() {
    this.handleUrl();
  },
  methods: {
    handleUrl() {
      const companyName = this.$route.query.name;
      // console.log(window.globalUrl.companyName);
      this.$get(this.$Url.EI.qccToken).then((res) => {
        let data = res.data;
        // console.log(data);
        let originUrl = `https://pro-plugin.qcc.com/plugin-login?key=d31a397da54111eea3f10c42a106ce72&token=${data}&returnUrl=/company-gateway?keyword=${companyName}&exactMatchFlag=Y`;
        this.iframeUrl = originUrl;
      });
      // let str =
      // ("YOmzUcw5WJmBOXSOUnkJpEzFAsUHIPw7R7yEa9K050rZL2BDarPfjphHc1xYdDtvphV+HPKghTqm6bKo9P0tR9aD24Hr8P9CzRS/+4LjsiLPByddokxJpD6cABHr/NjJl0tiublYBbLGRtPGPjB9OA==");
      // let encodeStr = encodeURIComponent(str);
      // let originUrl = `https://pro-plugin.qcc.com/plugin-login?key=f2a42d88278a11eea3f10c42a106ce72&token=${encodeStr}&returnUrl=/companyDetail?keyNo=9cce0780ab7644008b73bc2120479d31`;

      // keyword 可为企业名称 或 统一社会信用代码
      // let originUrl = `https://pro-plugin.qcc.com/plugin-login?key=f2a42d88278a11eea3f10c42a106ce72&token=${encodeStr}&returnUrl=/company-gateway?keyword=四川海思科制药有限公司&exactMatchFlag=Y`;
      // this.iframeUrl = originUrl;
    },
  },
};
</script>
<style lang="scss" scoped>
iframe {
  width: 100%;
  height: calc(100vh - 60px);
}
</style>
